const express = require('express');
const router = express.Router();
const { add, list, remove, update, listone } = require('../controllers/positions')

const { auth } = require('../middlewares/auth')
const uploadMiddleware = require('../middlewares/upload')

// router.post('/add', auth, add)
// router.post('/add', upload.single('companyLogo'), add)
router.post('/add', uploadMiddleware, add) // 为了容错上传，引入中间件
router.get('/', list)
router.delete('/', remove)
router.get('/listone', listone)
router.patch('/', uploadMiddleware, update)

module.exports = router;
